use alloc::sync::Arc;

use crate::sched::task::Task;

cfg_if::cfg_if! {
    if #[cfg(target_arch = "aarch64")] {
        mod aarch64;
        use aarch64::*;
        pub(crate) use aarch64::ThreadStruct;
    } else {
        mod dummy;
        use dummy::*;
        pub(crate) use dummy::ThreadStruct;
    }
}

pub(super) const TASK_NEED_RESCHED: u32 = ARCH_NEED_RESCHED;

#[inline(always)]
pub(crate) fn switch_to(prev: &Task, next: Arc<Task>) -> &Task {
    arch_switch_to(prev, next)
}
